setGlobalDuration(30)

example = 1

if example == 1:
    sine(pitch=[random.randint(100,3000) for i in range(50)], amplitude=.1, out=1)
    playSound('ounkmaster.aif', loop=True, out=2)
    crossSynth(1, 2, fftsize=2048, overlaps=4, windowsize=2048)

elif example == 2:
    freqMod(pitch=[50,200,350,500], amplitude=.1, modulator=.496, index=7, out=1)
    playSound('ounkmaster.aif', loop=True, out=2)
    crossSynth(1, 2, fftsize=1024, overlaps=8, windowsize=4096)

elif example == 3:
    env = genAdsr()
    a = genLineseg([0,10,1,5,1])
    readTable(bus='var', table=a)
    sine(pitch=[random.randint(100,3000) for i in range(50)], amplitude=.05, envelope=env, out=1)
    playSound('ounkmaster.aif', loop=True, out=2)
    crossSynth(1, 2, fftsize=2048, overlaps=4, windowsize=2048, cross=0.5, crossVar='var')

startCsound()